<template>
  <div class="row">
    <div class="col-md-12">
      <div class="index-card">
        <div class="index-card-head">
          <h3>最新发布</h3>
        </div>
        <div class="index-card-body">
          <div class="index-card-body-list"  v-for="a in articles" :key="a.id">
            <span style="font-size: 12px;color:#aaa;margin-right: 5px;">{{a.createDate}}</span>
            <a style="cursor: pointer" target="_blank" itemprop="url" @click="view(a.id)">{{a.title}}</a>
          </div>
        </div>
        <div class="index-card-footer" style="text-align: right;">
          <a href="/#/archives">查看更多</a>
        </div>
      </div>
    </div>
  </div>
</template>

<script >
    export default {
      props: {
        articles: {
          type: Array,
          required: true
        },
        itemStyle: Object
      },
      data() {
        return {}
      },
      methods: {
        view(id) {
          this.$router.push({path: `/view/${id}`})
        }
      }
    }
</script>

<style>

</style>
